import { createRouter, createWebHashHistory } from 'vue-router'
import Layout from '@/layout'

const routes = [
  {
    path: '/login',
    name: 'Login',
    component: () => import('../views/login')
  },
  {
    path: '/',
    component: Layout,
    redirect: '/home',
    children: [
      {
        path: 'home',
        name: 'Home',
        component: () => import('@/views/home/index')
      },
      {
        path: 'appointment',
        name: 'Appointment',
        component: () => import('@/views/appointment/index')
      },
      {
        path: 'article',
        name: 'Article',
        component: () => import('@/views/article/index')
      },
      {
        path: 'notice',
        name: 'Notice',
        component: () => import('@/views/notice/index')
      },
      {
        path: 'counselor',
        name: 'Counselor',
        component: () => import('@/views/counselor/index')
      },
      {
        path: 'client',
        name: 'Client',
        component: () => import('@/views/client/index')
      },
      {
        path: 'admin',
        name: 'Admin',
        component: () => import('@/views/sys_admin/index')
      },
      {
        path: 'personnalSettings',
        name: 'PersonnalSettings',
        component: () => import('@/views/personnalSettings/index')
      }
    ]
  }
]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router
